#ifndef _CREDIT_STATE_H_
#define _CREDIT_STATE_H_

#include "input/mouse.h"
#include "gameflow/ui_state.h"
#include "graphics/graphics.h"
#include "math/counter.h"
namespace camera
{
	class FbCamera;
	class RTCamera;
	class AbstractCamera;
}
namespace ui
{
	class UIWidget;
}

namespace LuaPlus
{
	class LuaState;
}

class CreditState : public gameflow::UIState
{
public:
						CreditState(	camera::FbCamera*	pCamera );
	virtual				~CreditState();

	/// called when the game flow manager transitions into this game state
	virtual	bool		OnEnter();

	/// called when the game flow manager transitions out of this game state
	virtual	bool		OnExit();

	virtual	bool		Tick(float dt);

	/// render the game
	virtual	bool		PostRender();

	virtual void		OnMOGAKeyDownEvent(int	KeyCode); 

private:
	static const int			ENTRY_C	=	17;
	struct						TextWidget
	{
		ui::UIWidget*				pWidget;
		math::Counter				Countdown;
	};
	static const float			COUNTDOWN_TIME;
	TextWidget					m_EntryA[ENTRY_C];


	struct		TextEntry
	{
		std::string			Text;
		bool				Header;
	};
	void				FillEntry(int index);


	std::vector<TextEntry>		m_Text;
	int							m_CurrentIndex;
	math::Vec2					m_Range;
};

#endif // _CREDIT_STATE_H_